

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	  xmlns:layout="http://www.thymeleaf.org/extras/dialect"
	  layout:decorate="layout/layout_login"
>
<head>
	<meta https-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta https-equiv="X-UA-Compatible" content="IE=edge">
	<title>注册新用户</title>
	<meta charset="utf-8"/>
	<link rel="stylesheet" href="../../static/asset/css/base.min.css" th:href="@{/asset/css/base.min.css}"/>
	<link rel="stylesheet" href="../../static/asset/css/common/front.css" th:href="@{/asset/css/common/front.css}"/>
	<link rel="stylesheet" href="../../static/asset/css/back/login.css" th:href="@{/asset/css/back/login.css}"/>
</head>
<body>
<div layout:fragment="content" class="wrapper login-wrapper">
	<div class="login-container ">
		<form th:action="@{/register}" method="post" class="login-form " th:object="${user}">
			<div class="logo-name text-center mb-5">欢迎注册</div>

			<div class="alert alert-danger" th:if="${param.error}">
				<i class="fa fa-times-circle"></i>
				<th:block th:text="#{user.login.usernameNotFound}">Invalid username and password.</th:block>
			</div>

			<div class="form-group">
				<input id="email" name="email" type="text" class="form-control" placeholder="邮箱" th:field="*{email}"
					   required data-rule-email="true" data-msg-email="不是有效的邮箱地址" data-msg-required="不能为空">
				<div class="form-control-feedback text-danger" th:errors="*{email}"></div>
				<small class="form-text text-muted">可用于找回密码</small>
			</div>

			<div class="form-group">
				<input id="username" name="username" type="text" class="form-control" placeholder="账号"
					   required data-msg-required="不能为空">
				<div class="form-control-feedback text-danger" th:errors="*{username}"></div>
			</div>
			<div class="form-group">
				<input id="password" name="password" type="password" class="form-control" placeholder="密码"
					   required data-msg-required="不能为空">
				<div class="form-control-feedback text-danger" th:errors="*{password}"></div>
			</div>
			<div class="form-group">
				<input id="verify" name="verify" type="password" class="form-control" placeholder="重复密码"
					   data-rule-equalTo="#password" data-msg-equalTo="两次输入不一致">
				<div class="form-control-feedback text-danger" th:errors="*{verify}"></div>
			</div>

			<!--<div class="form-group">-->
			<!--<input name="phone" type="text" class="form-control" placeholder="手机">-->
			<!--</div>-->

			<!--<div class="form-check">-->
			<!--<label class="custom-control custom-checkbox">-->
			<!--<input type="checkbox" class="custom-control-input">-->
			<!--<span class="custom-control-indicator"></span>-->
			<!--<span class="custom-control-description" th:text="#{user.login.remember}">记住我</span>-->
			<!--</label>-->
			<!--</div>-->

			<div class="form-group">
				<input type="submit" class="btn btn-block btn-primary" value="注册">
			</div>

			<div class="text-right">
				<a href="#" th:href="@{/login}">已有账号，前往登录</a>
				<a href="#" th:href="@{/forgot}" class="border border-primary border-bottom-0 border-top-0 border-right-0 pl-2 ml-1">忘记密码</a>
			</div>
		</form>
	</div>
</div>

<th:block layout:fragment="script">
	<script type="text/javascript" src="../../static/asset/js/base.min.js" th:src="@{/asset/js/base.min.js}"></script>
	<script type="text/javascript" src="../../static/asset/js/form.min.js" th:src="@{/asset/js/form.min.js}"></script>
	<script type="text/javascript" src="../../static/asset/js/app.js" th:src="@{/asset/js/app.js}"></script>
	<script>
        $(function () {
            $('form').validate();
        })
	</script>
</th:block>
</body>
</html>
